home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
extra
/
pro13
/
vaa.c
< prev
next >
Wrap
Text File
|
1993-02-01
|
1KB
|
86 lines
/*
vaa.C
Copyright (C) 1993, Geoff Friesen B.Sc.
All rights reserved.
*/
#define INCL_VAA
int v_aa (void)
{
asm mov ax,1a00h /* Check for VGA */
VIDEO_INT
asm cmp al, 1ah /* Found VGA? */
asm jnz v_aa1 /* No, branch */
asm cmp bl, 7 /* Active VGA connected to BW monitor? */
asm jz v_aa4 /* Yes, branch */
asm cmp bl, 8 /* Active VGA connected to COL monitor? */
asm jz v_aa3 /* Yes, branch */
v_aa1:
asm mov ah, 12h /* Check for EGA */
asm mov bl, 10h
VIDEO_INT
asm cmp bl, 10h /* Found EGA? */
asm jz v_aa2 /* No, branch */
asm mov ax, 0
asm mov es, ax
asm test BYTE PTR es:[487h], 8 /* EGA active? */
asm jnz v_aa2 /* No, branch */
asm test WORD PTR es:[463h], 40h /* BW or COLOR monitor? */
asm jnz v_aa5 /* Branch if COLOR */
asm jmp SHORT v_aa6 /* Must be BW */
v_aa2:
asm mov ax, 0
asm mov es, ax
asm test WORD PTR es:[463h], 40h /* CGA? */
asm jnz v_aa7 /* Yes, branch */
asm jmp SHORT v_aa8 /* Must be MDA */
v_aa3:
asm mov ax, VGA_COLOR
asm jmp SHORT v_aa9
v_aa4:
asm mov ax, VGA_BW
asm jmp SHORT v_aa9
v_aa5:
asm mov ax, EGA_COLOR
asm jmp SHORT v_aa9
v_aa6:
asm mov ax, EGA_BW
asm jmp SHORT v_aa9
v_aa7:
asm mov ax, CGA
asm jmp SHORT v_aa9
v_aa8:
asm mov ax, MDA
v_aa9:
return _AX;
}